package com.dwms.feign.system;


import com.dwms.entity.DictInfoVO;
import com.dwms.entity.PageResponse;
import com.dwms.entity.QueryRequest;
import com.dwms.entity.Result;
import com.dwms.entity.system.dict.item.request.DictItemQueryRequest;
import com.dwms.entity.system.dict.item.request.DictItemRequest;
import com.dwms.entity.system.dict.item.response.DictItemResponse;
import com.dwms.entity.system.dict.request.DictQueryRequest;
import com.dwms.entity.system.dict.request.DictRequest;
import com.dwms.entity.system.dict.response.DictResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;


/**
 * @ClassName: DictMapper
 * @Description: Dict
 * @Create 2022/03/05 20:46
 * @Author WH
 * @Since 2.0.0
**/
@FeignClient(value = "system-server", path = "/dict")
public interface DictFeignClient {

    /**
     * 新增数据字典
     * @param dictRequest
     * @return
     */
    @PostMapping("/save")
    Result save(@RequestBody DictRequest dictRequest);

    /**
     * 修改数据字典
     * @param dictRequest
     * @return
     */
    @PostMapping("/update")
    Result update(@RequestBody DictRequest dictRequest);

    /**
     * 分页查询数据字典
     * @param query
     * @return
     */
    @PostMapping("/findPage")
    Result<PageResponse<DictResponse>> findPage(@RequestBody DictQueryRequest query);

    /**
     * 根据ID查询
     * @param query
     * @return
     */
    @PostMapping("/findById")
    Result findById(@RequestBody QueryRequest query);

    /**
     * 删除数据字典
     * @param query
     * @return
     */
    @PostMapping("/delete")
    Result delete(@RequestBody QueryRequest query);

    /**
     * 新增字典明细
     * @param dictItemRequest
     * @return
     */
    @PostMapping("/saveItem")
    Result saveItem(@RequestBody DictItemRequest dictItemRequest);

    /**
     * 修改字典明细
     * @param dictItemRequest
     * @return
     */
    @PostMapping("/updateItem")
    Result updateItem(@RequestBody DictItemRequest dictItemRequest);

    /**
     * 分页查询字典明细
     * @param query
     * @return
     */
    @PostMapping("/findItemPage")
    Result<PageResponse<DictItemResponse>> findItemPage(@RequestBody DictItemQueryRequest query);

    /**
     * 根据ID查询
     * @param query
     * @return
     */
    @PostMapping("/findItemById")
    Result findItemById(@RequestBody QueryRequest query);

    /**
     * 删除字典明细
     * @param query
     * @return
     */
    @PostMapping("/deleteItem")
    Result deleteItem(@RequestBody QueryRequest query);

    /**
     * 根据字典编码查询字典明细
     * @param query
     * @return
     */
    @PostMapping("/findByKeywords")
    Result<List<DictInfoVO>> findByKeywords(@RequestBody DictItemQueryRequest query);
}
